package rota.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@SequenceGenerator(name = "id_seq", sequenceName = "id_seq", initialValue = 1, allocationSize = 1) 
@Entity						//especifica q a classe e uma entidade e q sera gravada no banco.
@Table(name="tb_contacts")		//informa a tabela
public class Contact {
	
	@Id						//informa a chave prim�ria	
    @Column					//informa a coluna
    @GeneratedValue	(strategy = GenerationType.SEQUENCE, generator = "id_seq")//gera a sequencia de id sequencial ou nao, ex de 2 em 2
    private int id;
 
    @Column
    private String firstname;
 
    @Column
    private String lastname;
 
    @Column
    private String email;
 
    @Column
    private String telephone;
 
    public String getEmail() {
        return email;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public String getFirstname() {
        return firstname;
    }
    public String getLastname() {
        return lastname;
    }
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
}
